3.1.35 \(\int (a \cos (c+d x)+b \sin (c+d x)) \, dx\) [35]

Optimal. Leaf size=24 \[ -\frac {b \cos (c+d x)}{d}+\frac {a \sin (c+d x)}{d} \]

[Out]

-b*cos(d*x+c)/d+a*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 24, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2717, 2718} \begin {gather*} \frac {a \sin (c+d x)}{d}-\frac {b \cos (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[a*Cos[c + d*x] + b*Sin[c + d*x],x]

[Out]

-((b*Cos[c + d*x])/d) + (a*Sin[c + d*x])/d

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int (a \cos (c+d x)+b \sin (c+d x)) \, dx &=a \int \cos (c+d x) \, dx+b \int \sin (c+d x) \, dx\\ &=-\frac {b \cos (c+d x)}{d}+\frac {a \sin (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 46, normalized size = 1.92 \begin {gather*} -\frac {b \cos (c) \cos (d x)}{d}+\frac {a \cos (d x) \sin (c)}{d}+\frac {a \cos (c) \sin (d x)}{d}+\frac {b \sin (c) \sin (d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[a*Cos[c + d*x] + b*Sin[c + d*x],x]

[Out]

-((b*Cos[c]*Cos[d*x])/d) + (a*Cos[d*x]*Sin[c])/d + (a*Cos[c]*Sin[d*x])/d + (b*Sin[c]*Sin[d*x])/d

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 25, normalized size = 1.04

method result size
derivativedivides \(\frac {-b \cos \left (d x +c \right )+a \sin \left (d x +c \right )}{d}\) \(23\)
default \(-\frac {b \cos \left (d x +c \right )}{d}+\frac {a \sin \left (d x +c \right )}{d}\) \(25\)
risch \(-\frac {b \cos \left (d x +c \right )}{d}+\frac {a \sin \left (d x +c \right )}{d}\) \(25\)
norman \(\frac {\frac {2 b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}\) \(50\)
meijerg \(\frac {\left (\cos \left (c \right ) \sqrt {\pi }\, a +\sqrt {\pi }\, \sin \left (c \right ) b \right ) \sin \left (d x \right )}{\sqrt {\pi }\, d}+\frac {\left (\cos \left (c \right ) \sqrt {\pi }\, b -\sqrt {\pi }\, \sin \left (c \right ) a \right ) \left (\frac {1}{\sqrt {\pi }}-\frac {\cos \left (d x \right )}{\sqrt {\pi }}\right )}{d}\) \(61\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a*cos(d*x+c)+b*sin(d*x+c),x,method=_RETURNVERBOSE)

[Out]

-b*cos(d*x+c)/d+a*sin(d*x+c)/d

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 24, normalized size = 1.00 \begin {gather*} -\frac {b \cos \left (d x + c\right )}{d} + \frac {a \sin \left (d x + c\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*cos(d*x+c)+b*sin(d*x+c),x, algorithm="maxima")

[Out]

-b*cos(d*x + c)/d + a*sin(d*x + c)/d

________________________________________________________________________________________

Fricas [A]
time = 2.85, size = 23, normalized size = 0.96 \begin {gather*} -\frac {b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*cos(d*x+c)+b*sin(d*x+c),x, algorithm="fricas")

[Out]

-(b*cos(d*x + c) - a*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [A]
time = 0.05, size = 31, normalized size = 1.29 \begin {gather*} a \left (\begin {cases} \frac {\sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \cos {\left (c \right )} & \text {otherwise} \end {cases}\right ) + b \left (\begin {cases} - \frac {\cos {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \sin {\left (c \right )} & \text {otherwise} \end {cases}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*cos(d*x+c)+b*sin(d*x+c),x)

[Out]

a*Piecewise((sin(c + d*x)/d, Ne(d, 0)), (x*cos(c), True)) + b*Piecewise((-cos(c + d*x)/d, Ne(d, 0)), (x*sin(c)
, True))

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 24, normalized size = 1.00 \begin {gather*} -\frac {b \cos \left (d x + c\right )}{d} + \frac {a \sin \left (d x + c\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a*cos(d*x+c)+b*sin(d*x+c),x, algorithm="giac")

[Out]

-b*cos(d*x + c)/d + a*sin(d*x + c)/d

________________________________________________________________________________________

Mupad [B]
time = 0.36, size = 38, normalized size = 1.58 \begin {gather*} -\frac {2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a*cos(c + d*x) + b*sin(c + d*x),x)

[Out]

-(2*cos(c/2 + (d*x)/2)*(b*cos(c/2 + (d*x)/2) - a*sin(c/2 + (d*x)/2)))/d

________________________________________________________________________________________